import autosar

ws = autosar.workspace("4.2.2")
package = ws.createPackage('AUTOSAR_Platform')
baseTypes = package.createSubPackage('BaseTypes')
baseTypes.createSwBaseType('dtRef_const_VOID', 1, encoding = 'VOID', nativeDeclaration = 'void')
baseTypes.createSwBaseType('dtRef_VOID', 1, encoding = 'VOID', nativeDeclaration = 'void')
baseTypes.createSwBaseType('boolean', 8, encoding = 'BOOLEAN', nativeDeclaration='boolean')
baseTypes.createSwBaseType('float32', 32, encoding = 'IEEE754', nativeDeclaration = 'float32')
baseTypes.createSwBaseType('float64', 64, encoding = 'IEEE754', nativeDeclaration = 'float64')
baseTypes.createSwBaseType('sint8', 8, encoding = '2C', nativeDeclaration='sint8')
baseTypes.createSwBaseType('sint16', 16, encoding = '2C', nativeDeclaration='uint16')
baseTypes.createSwBaseType('sint32', 32, encoding = '2C', nativeDeclaration='sint32')
baseTypes.createSwBaseType('uint8', 8, nativeDeclaration='uint8')
baseTypes.createSwBaseType('uint16', 16, nativeDeclaration='uint16')
baseTypes.createSwBaseType('uint32', 32, nativeDeclaration='uint32')
ws.saveXML('AUTOSAR_Platform.arxml', filters=['/AUTOSAR_Platform'])